package com.company;

import java.io.*;
import java.util.Scanner;

public class copytest {
    public static void main(String[] args)  {
        try {
            //完成文件复制
            //frompath  源文件路径
            // topath   目标文件路径
            String frompath=new Scanner(System.in).nextLine();
            String topath  =new Scanner(System.in).nextLine();
            copyof(frompath,topath);
        }catch (Exception e){
            e.printStackTrace();
        }finally {

        }

    }
    public static void copyof(String frompath,String topath) {
        InputStream in=null;
        OutputStream out=null;
        try {
            in= new BufferedInputStream(new FileInputStream(frompath));
            out=new BufferedOutputStream(new FileOutputStream(topath));
            int b=0;
            while ((b=in.read())!=-1){
                out.write(b);
            }

        }catch (Exception e){
            e.printStackTrace();
        }finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
            try {
                out.close();
            } catch (IOException e) {
                e.printStackTrace();
            }

        }

    }
}
